package com.example.day45.eventbus;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * @author zhangwei
 * @version V1.0
 * @Title: Advanced
 * @Package com.example.day45.eventbus
 * @Description:
 * @date 15/10/29 下午3:47
 */

public class VpFragmentAdapter extends FragmentStatePagerAdapter {
    private List<Fragment> fragments;

    public VpFragmentAdapter(FragmentManager fm, List<Fragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }
}
